<template>
  <div class="result">
    <div>
		<i class="el-icon-success" v-if="isSuccess"></i>
		<i class="el-icon-error" v-if="!isSuccess"></i>
    </div>
    <div class="title">
      <slot name="title">
        {{ title }}
      </slot>
    </div>
    <div class="description">
      <slot name="description">
        {{ description }}
      </slot>
    </div>
	<div class="extra" v-if="$slots.default">
		<slot></slot>
	</div>
	<div class="action" v-if="$slots.action">
		<slot name="action"></slot>
	</div>
  </div>
</template>

<script>

export default {
  name: 'Result',
  props: {
    isSuccess: {
      type: Boolean,
      default: false
    },
    title: {
      type: String,
      default: ''
    },
    description: {
      type: String,
      default: ''
    }
  },
}
</script>

<style lang="less" scoped>
  .result {
    text-align: center;
    width: 72%;
    margin: 0 auto;
    padding: 24px 0 8px;
    .el-icon-success {
		color: #52c41a;
		font-size: 72px;
		line-height: 72px;
		margin-bottom: 24px;
    }
    .el-icon-error {
		color: red;
		font-size: 72px;
		line-height: 72px;
		margin-bottom: 24px;
    }
    .title {
      font-size: 24px;
      color: rgba(0, 0, 0, .85);
      font-weight: 500;
      line-height: 32px;
      margin-bottom: 16px;
    }
    .description {
      font-size: 14px;
      line-height: 22px;
      color: rgba(0, 0, 0, 0.45);
      margin-bottom: 24px;
    }
	.extra {
		background: #fafafa;
		padding: 24px 40px;
		border-radius: 2px;
		text-align: left;
	}
	.action {
		margin-top: 32px;
	}
  }
</style>
